load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "row",
    srcs = [
        "deleter.go",
        "errors.go",
        "expr_walker.go",
        "fetcher.go",
        "fk_uniq_spans.go",
        "helper.go",
        "inserter.go",
        "kv_batch_fetcher.go",
        "kv_batch_streamer.go",
        "kv_fetcher.go",
        "locking.go",
        "partial_index.go",
        "putter.go",
        "row_converter.go",
        "truncate.go",
        "updater.go",
        "writer.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/row",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvclient/kvstreamer",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/catsessiondata",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/schemaexpr",
        "//pkg/sql/catalog/seqexpr",
        "//pkg/sql/colmem",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/rowenc/rowencpb",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/rowinfra",
        "//pkg/sql/scrub",
        "//pkg/sql/sem/builtins/builtinconstants",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/transform",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/volatility",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/span",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/util",
        "//pkg/util/admission",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/buildutil",
        "//pkg/util/encoding",
        "//pkg/util/errorutil/unimplemented",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/log/eventpb",
        "//pkg/util/log/logpb",
        "//pkg/util/log/severity",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "//pkg/util/unique",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//oid",
    ],
)

go_test(
    name = "row_test",
    size = "medium",
    srcs = [
        "expr_walker_test.go",
        "external_row_data_test.go",
        "fetcher_mvcc_test.go",
        "fetcher_test.go",
        "main_test.go",
    ],
    embed = [":row"],
    deps = [
        "//pkg/base",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvserver",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowinfra",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)

disallowed_imports_test(
    "row",
    ["//pkg/sql/execinfra"],
)
